import request from '@/utils/Request'

export const loadOrderListApi =(data)=>{
    return request.get ('/orders/selectAllByPage',{
        params:data
    })
}
export const loadOrderByOrderNumApi =(data)=>{
    return request.get ('/orders/selectAllByPage',{
        params:data
    })
}
export const loadOrderDetailApi =(data)=>{
    return request.get (`/orders/selectOrderDetailsByOrderId/${data.orderId}`)
}

export const updateOrderStatusApi =(data)=>{
    return request.put('/orders/updateOrderStatus',data)
}
/**
 * 删除订单接口，将订单状态改为已删除
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const deleteOrderApi =(data)=>{
    return request.put('/orders/updateOrderStatus',data)
}

export const deleteBatchOrderApi =(data)=>{
    return request.get('/orders/countSales',{
        params:data.days
    })
}